package com.springmvc.crud.handler.formatType.converters;

import com.springmvc.crud.entity.Department;
import com.springmvc.crud.entity.Employee;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

/**
 * Created by BF100233 on 2016/9/26.
 */
//
//@Component
//public class EmployeeConverters implements Converter<String,Employee> {
//
//    public Employee convert(String sour) {
//        if (sour != null) {
//            String[] strings = sour.split("-");
//            if (strings.length==4){
//                Department department = new Department(Integer.parseInt(strings[3]));
//                Employee employee=new Employee(strings[0], strings[1], Integer.parseInt(strings[2]),department);
//                return employee;
//            }
//        }
//        return null;
//    }
//}
